<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function getRandomStr() {
            const str = "abacdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789";
            let randomStr = "";
            for (let i = 0; i < 8; i++) {
                const index = Math.random().toFixed(str.length - 1)
                randomStr += index;
            }
            return randomStr;
        }
        function  getQueryString(name)
        {
            var  reg = new  RegExp( "(^|&)" + name + "=([^&]*)(&|$)" );
            var  r = window.location.search.substr(1).match(reg);
            if (r!= null ) return   unescape(r[2]); return  null ;
        }
        function register(){
            const request = new XMLHttpRequest();
            request.onreadystatechange = function (){
                if (request.readyState==4 && request.status===200){
                    const res = request.responseText;
                    console.log('res',res)
                }
            }
            request.open('POST','http://localhost:8080/auth/register')
            request.send()
        }
        
        document.onload = function () {
            document.getElementById("#username").value = getRandomStr();
            document.getElementById("#password").value = getRandomStr();
            document.getElementById("#account").value = getRandomStr();
            document.getElementById("#phone").value = 191122211131;
            
        }


       
    </script>
</head>
<body>
<div>
    <div>
        <input id="username"/>
    </div>
    <div>
        <input id="account"/>
    </div>
    <div>
        <input id="password"/>
    </div>
    <div>
        <input id="phone"/>
    </div>
</div>
<input type="button" value="注册" onclick="register()"/>
</body>
</html>